package com.msmall.community.common.service;

import java.util.List;

import com.msmall.base.service.BaseManager;
import com.msmall.community.common.model.Message;

/**
 * 系统消息
 */
public interface MessageManager extends BaseManager<Message, Long>{

	public List<Message> getMessages(Long sender, Long receiver);
	
	public List<Message> getMessages(Long sender, Long receiver, Integer type);
	
	/**
	 * 获得用户的所有消息
	 */
	public List<Message> getMessagesByUserid(Long receiver);
	
	public void deleteMessage(Long sender, Long receiver);
	
	/**
	 * 将消息状态设置为已读
	 * @param messageid
	 */
	public void setRead(Long messageid);
	
	/**
	 * 好友请求时，发送系统消息给用户
	 */
	public void askMessage(Long sender, Long receiver, String content);
	/**
	 * 同意好友请求时，发送系统消息给用户
	 */
	public void acceptMessage(Long sender, Long receiver);
	/**
	 * 拒绝好友请求时，发送系统消息给用户
	 */
	public void rejectMessage(Long sender, Long receiver);
	
	
	/**
	 * 组长/副组长 邀请用户，被邀请人接受到消息
	 * 格式参考 Message 说明
	 */
	public void inviteTeamMessage(Long senderid, Long receiverid, Long teamid);
	
	/**
	 * 用户申请加入群组时，通知组长/副组长
	 */
	public void joinTeamMessage(Long senderid, List<Long> receivers, Long teamid);
	
	/**
	 * 组长/副组长 通过用户申请,通知用户
	 */
	public void joinTeamAcceptMessage(Long senderid, Long receiverid, Long teamid);
	/**
	 * 组长/副组长 拒绝用户申请,通知用户
	 */
	public void joinTeamRejectMessage(Long senderid, Long receiverid, Long teamid);
	
	/**
	 * 用户退出,通知用户
	 */
	public void leaveTeamUserMessage(Long receiverid, Long teamid);
	/**
	 * 组长修改了组员/副组长 职位
	 */
	public void teamPositionMessage(Long senderid, Long receiverid, Long teamid);
}
